package com.itheima.static_case.Demo4;

public class Student1 {
    // 饿汉模式

    private String name;

    static Student1 student1 = new Student1();

    private Student1() {
    }

    public static Student1 getInstance() {
        return student1;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
